// File:    Permiso.cs
// Author:  bigmaster
// Created: viernes, 22 de noviembre de 2013 1:14:56
// Purpose: Definition of Class Permiso

using System;

public class Permiso
{
   public int idPermiso;
   public string nombrePermiso;
   
   public System.Collections.Generic.List<Rol> rol;
   
   /// <summary>
   /// Property for collection of Rol
   /// </summary>
   /// <pdGenerated>Default opposite class collection property</pdGenerated>
   public System.Collections.Generic.List<Rol> Rol
   {
      get
      {
         if (rol == null)
            rol = new System.Collections.Generic.List<Rol>();
         return rol;
      }
      set
      {
         RemoveAllRol();
         if (value != null)
         {
            foreach (Rol oRol in value)
               AddRol(oRol);
         }
      }
   }
   
   /// <summary>
   /// Add a new Rol in the collection
   /// </summary>
   /// <pdGenerated>Default Add</pdGenerated>
   public void AddRol(Rol newRol)
   {
      if (newRol == null)
         return;
      if (this.rol == null)
         this.rol = new System.Collections.Generic.List<Rol>();
      if (!this.rol.Contains(newRol))
         this.rol.Add(newRol);
   }
   
   /// <summary>
   /// Remove an existing Rol from the collection
   /// </summary>
   /// <pdGenerated>Default Remove</pdGenerated>
   public void RemoveRol(Rol oldRol)
   {
      if (oldRol == null)
         return;
      if (this.rol != null)
         if (this.rol.Contains(oldRol))
            this.rol.Remove(oldRol);
   }
   
   /// <summary>
   /// Remove all instances of Rol from the collection
   /// </summary>
   /// <pdGenerated>Default removeAll</pdGenerated>
   public void RemoveAllRol()
   {
      if (rol != null)
         rol.Clear();
   }

}